<!DOCTYPE html>
<html>
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>设置您的登录密码</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link href="../assets/mobile/comm.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="../assets/mobile/top.css">
	<link href="../assets/mobile/login.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
    <link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
    <link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/jquery.form.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
</head>
<body style="position:static !important;">
<div class="h5-1yyg-v1" id="content">
<!--通用顶部-->
<div id="ios-top-box">
	<div id="header" class="bar bar-nav">
	<div class="titlebar">
	<a href="javascript:appClose('findsetpwd',api);"><i class="iconfont iconline-arrow-left"></i></a>
	<h1 class="title">重置密码</h1>
	</div>
	</div>
</div>
<!--通用顶部结束-->

        <section style="margin-top:44px;">
		<form class="registerform" method="post" action="resetpassword">
        <div class="registerCon">
	        <ul>
				<li>
					<p class="Ptxt_F14">请重新设置您的登录密码<span class="orange Fb" style="display:none;">您的帐号是</span></p>
				</li>
				<li><input name="userpassword" type="password" id="txtPassword" placeholder="新密码" class="rText"><s class="rs3"></s>
				</li>
				<li><input name="userpassword2" type="password" id="txtPassword2" placeholder="确认密码" class="rText"><s class="rs3"></s>
				</li>
                <li><input type="submit"  id="submitBtn" style="background:#c40c00;color:#FFFFFF" name="submit" class="login_Email_but" value="确认修改" /></li>
			</ul>
        </div>
		</form>
        </section>
</div>

<script type="text/javascript">
apiready = function(){
	$(function(){
		if(!localData.get('findmobilecheck') || !localData.get('mobile')){
			api.alert({title:'提示',msg:'非法操作'},function(index,err){
				api.closeWin({name:'findsetpwd'});
			});
			return false;
		}
		$('.registerform').submit(function(){
			var txtPassword = $('#txtPassword').val();
			var txtPassword2 = $('#txtPassword2').val();
			if(!txtPassword || txtPassword.length < 6 || txtPassword.length > 20){
				$.PageDialog.fail('密码小于6位或大于20位');
				return false;
			} else if (!txtPassword2 || txtPassword != txtPassword2) {
				$.PageDialog.fail('两次密码输入不一致');
				return false;
			}
			api.showProgress({'title':'正在修改','text':''});
			var mobile = localData.get('mobile');
			var passcode = localData.get('passcode');
			$(this).ajaxSubmit({
				url : config.url+'/app.php?act=resetpassword',
				dataType:'json',
				data : {submit : true,mobile:mobile,passcode:passcode},
				success : function(data){
					api.hideProgress();
					if(data['status']){
						$.PageDialog.ok('<s></s>'+data['msg']);
						localData.clear();
						setTimeout(function(){
							appClose('findpwd',api);
							randomSwitchBtn('login',api);
							appClose('findsetpwd',api);
						},1200);
					}else{
						$.PageDialog.fail(data['msg']);
					}
				}
			});
			return false;
		});
	});
};
</script>
</body>
</html>